package com.hzy.oms.controller;

import com.hzy.oms.service.OrderPayService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * 微信回调接口列表Controller
 * 
 * @author sjm
 * @date 2023-04-05
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/oms/notify")
public class PayNotifyController {

    private final OrderPayService orderPayService;

    /**
     * 微信支付回调
     * @param request
     * @throws IOException
     */
    @PostMapping("/wechat")
    public void weChatPayNotify(HttpServletRequest request) throws Exception {
        orderPayService.payNotify(request);
    }

}
